package com.ck.dao;

import com.ck.model.common.ProgramDownload;
import org.apache.ibatis.annotations.Param;

public interface ProgramDownloadMapper {
    int deleteByPrimaryKey(Long programDownloadId);

    int insert(ProgramDownload record);

    int insertSelective(ProgramDownload record);

    ProgramDownload selectByPrimaryKey(Long programDownloadId);

    int updateByPrimaryKeySelective(ProgramDownload record);

    int updateByPrimaryKey(ProgramDownload record);

    /**
     * 根据节目版本号删除
     *
     * @param programVersion 节目版本号
     * @param companyCode    商家编号
     * @return 影响行数
     */
    int deleteByProgramVersion(@Param("programVersion") String programVersion, @Param("companyCode") String companyCode);

    /**
     * 批量删除节目的终端
     *
     * @param programVersion 节目版本号
     * @param deviceCodeArr  code数组
     * @return 影响行数
     */
    int batchDeleteDeviceFromProgram(@Param("programVersion") String programVersion, @Param("deviceCodeArr") String[] deviceCodeArr);

    /**
     * 批量从终端删除节目
     *
     * @param programVersionArr 节目版本号数组
     * @param deviceCode        code
     */
    void batchDeleteProgramFromDevice(@Param("programVersionArr") String[] programVersionArr, @Param("deviceCode") String deviceCode);
}